#ifndef MAINWINDOW_HPP
#define MAINWINDOW_HPP

#include <QMainWindow>
#include <QThread>
#include <QString>
#include <QList>
#include <QModelIndex>

#include "ReutersLoader.hpp"

class QMultiComboBox;
class ReutersDataModel;
class ReutersDataView;
class ReutersDocument;

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    
signals:

    void loadClassification (QString file);

    void filterData (QString filter);

    void loadDocument (ReutersDocument* document);

public slots:

    void searchItemChanged ();

    void selectPreloadedClsFile(int);

    void disableUI (bool full);

    void disableUI ();

    void enableUI ();

    void viewUpdated (ReutersDataView*);

    void showDocument (QModelIndex);

    void showDocument (ReutersDocument*);

    void setAcc (float acc);

    void onClsResLoading ();

    void onClsResLoaded (ReutersDataModel*);

private:
    Ui::MainWindow* ui;
    QMultiComboBox* searchBox_;
    QThread workerThread_;
    ReutersLoader reutersLoader_;
    ReutersDocument* currentDoc_;
    int currentClassifier_;

    bool loadClsFromFile(QString file_name);

    bool loadClsFile();
};

#endif // MAINWINDOW_HPP
